<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../js/vue.min.js"></script>
</head>
<body>
<div id="app">
    {{date}}
</div>
</body>
<script>
    var app = new Vue({
        el: '#app',
        data: {date: new Date()},
        mounted: function () {
            var vm = this;
            vm.timer = setInterval(function () {
                vm.date = new Date();
            }, 1000)
        },
        beforeCreated: function () {
        },
        created: function () {

        },
        beforeDestroy: function () {

        },
        formatTime: function (date) {
            return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
        }
    })
</script>
</html>